<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('修改试用期转正人员')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-trialJust-edit" AUTOCOMPLETE="OFF">
        <input name="id" id="id" type="hidden" th:value="${editTrialJustEmp.id}"/>
        <div class="form-group">
            <label class="col-sm-3 control-label ">工号：</label>
            <div class="col-sm-8">
                <input class="form-control" id="badge" type="text" th:value="${editTrialJustEmp.badge}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">姓名：</label>
            <div class="col-sm-8">
                <input class="form-control" id="name" type="text" th:value="${editTrialJustEmp.name}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">公司名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="compName" type="text" th:value="${editTrialJustEmp.compName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">部门名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="depName" type="text" th:value="${editTrialJustEmp.depName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">岗位名称：</label>
            <div class="col-sm-8">
                <input class="form-control" id="jobName" type="text" th:value="${editTrialJustEmp.jobName}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">入职时间：</label>
            <div class="col-sm-8">
                <input class="form-control" id="JoinDate" type="text" th:value="${editTrialJustEmp.joindate}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">试用开始日期：</label>
            <div class="col-sm-8">
                <input class="form-control" id="ProbBeginDate" type="text" th:value="${editTrialJustEmp.ProbBeginDate}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">试用期(月)：</label>
            <div class="col-sm-8">
                <input class="form-control" id="Probterm" type="text" th:value="${editTrialJustEmp.Probterm}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">试用结束日期：</label>
            <div class="col-sm-8">
                <input class="form-control" id="Probenddate" type="text" th:value="${editTrialJustEmp.Probenddate}"
                       readonly="readonly"/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label "><span style="color: red; ">*</span>评估结果：</label>
            <div class="col-sm-8">
                <select name="Result" id="Result" class="form-control"
                        th:with="type=${@dict.getType('eCD_PracResult')}">
                    <option value="">请选择</option>
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                            th:selected="${editTrialJustEmp.Result+'' == dict.dictValue}"
                            th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-3 control-label "><span style="color: red; ">*</span>转正日期：</label>
            <div class="col-sm-8">
                <input class="form-control laydate-demo-1" id="effectdate" name="effectdate" type="text"
                       th:value="${editTrialJustEmp.EffectDate}" required/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label ">备注：</label>
            <div class="col-sm-8">
                <input class="form-control" id="remark" name="remark" type="text" th:value="${editTrialJustEmp.remark}"
                       />
            </div>
        </div>
    </form>
</div>


<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "changeManage/TrialChangeJust";


    $(function () {
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });
        });

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });
        });

        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-3',
                type: 'date'
            });
        });
    });


    function submitHandler() {
        if ($.validate.form()) {
            var data = $("#form-trialJust-edit").serializeArray();
            var id = $("#id").val();
            var Result = $("#Result").val();
            var effectdate = $("#effectdate").val();
            var remark = $("#remark").val();

            if (Result == "" || Result == null) {
                $.modal.alertWarning("请选择评估结果!");
                return;
            } else if (effectdate == "" || effectdate == null) {
                $.modal.alertWarning("请填写实习转正日期!");
                return;
            }

            data.push({"name": "id", "value": id});
            data.push({"name": "Result", "value": Result});
            data.push({"name": "effectdate", "value": effectdate});
            data.push({"name": "remark", "value": remark});

            $.operate.save(prefix + "/edit", data);
        }
    }

</script>


</body>
</html>